package common

import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

type SourceIPMode string

const (
	VirtualIPAddress                    SourceIPMode = "VirtualIPAddress"
	PrimaryIPFromEgressGatewayInterface SourceIPMode = "PrimaryIPFromEgressGatewayNodeInterface"
)

type VirtualIPAddressSpec struct {
	IP               string   `json:"ip,omitempty"`
	RoutingTableName string   `json:"routingTableName,omitempty"`
	Interfaces       []string `json:"interfaces,omitempty"`
}

type PrimaryIPFromEgressGatewayNodeInterfaceSpec struct {
	InterfaceName string `json:"interfaceName,omitempty"`
}

type ExtendedCondition struct {
	metav1.Condition  `json:",inline"`
	LastHeartbeatTime metav1.Time `json:"lastHeartbeatTime,omitempty"`
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ExtendedCondition) DeepCopyInto(out *ExtendedCondition) {
	*out = *in
	in.Condition.DeepCopyInto(&out.Condition)
	in.LastHeartbeatTime.DeepCopyInto(&out.LastHeartbeatTime)
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtendedCondition.
func (in *ExtendedCondition) DeepCopy() *ExtendedCondition {
	if in == nil {
		return nil
	}
	out := new(ExtendedCondition)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *VirtualIPAddressSpec) DeepCopyInto(out *VirtualIPAddressSpec) {
	*out = *in
	if in.Interfaces != nil {
		in, out := &in.Interfaces, &out.Interfaces
		*out = make([]string, len(*in))
		copy(*out, *in)
	}
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualIPAddressSpec.
func (in *VirtualIPAddressSpec) DeepCopy() *VirtualIPAddressSpec {
	if in == nil {
		return nil
	}
	out := new(VirtualIPAddressSpec)
	in.DeepCopyInto(out)
	return out
}
